This is a dataset on airbnb in NYC. Only entire home/apt in Bronx which price is lower than $1000 is filtered.
data(nyc_airbnb)
airbnb_df = nyc_airbnb %>%
filter(
neighbourhood_group == "Bronx",
room_type == "Entire home/apt",
price < 1000)
This code plots a scatter plot on review_score_location and number of views.The color represents the price.
plot_ly(
airbnb_df,
x = ~number_of_reviews, y = ~review_scores_location,
type = "scatter", mode = "markers", color = ~price, alpha = 0.5
)
## Warning: Ignoring 54 observations
This boxplot below shows nuber of reviews of airbnb in different neighbourhoods in Bronx.
plot_ly(
airbnb_df,
y = ~number_of_reviews,
color = ~neighbourhood, type = "box"
)
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(N, 3L), "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
This barchart shows the review per month in different neibourhood in bronx of popular airbnbs which have more than 5 reviews per month.
pop_airbnb = filter(airbnb_df, reviews_per_month > 5)
plot_ly(
pop_airbnb,
x = ~reviews_per_month, y = ~neighbourhood,
color = ~neighbourhood, type = "bar",
orientation = "h"
)